//
// Created by 文道江 on 16/1/8.
// Copyright (c) 2016 文道江. All rights reserved.
//

#import <WebKit/WebKit.h>
#import <WebKit/WKNavigationDelegate.h>
#import "WKWebViewJavascriptBridge.h"
#import "URLSessionManager.h"
#import "SendSMSController.h"

#ifndef WVJB_WEBVIEW_TYPE
#define WVJB_WEBVIEW_TYPE WKWebView
#endif
#ifndef WVJB_WEBVIEW_DELEGATE_TYPE
#define WVJB_WEBVIEW_DELEGATE_TYPE NSObject<WKNavigationDelegate>
#endif

@interface WebViewClient : NSObject <WKNavigationDelegate>{
    id _webDelegate;
    UIViewController * _controller;
}
- (instancetype)initWithController:(UIViewController *)controller;

+ (instancetype)clientWithController:(UIViewController *)controller;


- (WKWebViewJavascriptBridge *)bridgeForWebView:(WVJB_WEBVIEW_TYPE*)webView handler:(WVJBHandler)handler ;

- (WKWebViewJavascriptBridge *)bridgeForWebView:(WVJB_WEBVIEW_TYPE*)webView webViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE*)webViewDelegate handler:(WVJBHandler)messageHandler;

- (WKWebViewJavascriptBridge *)bridgeForWebView:(WVJB_WEBVIEW_TYPE*)webView webViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE*)webViewDelegate handler:(WVJBHandler)messageHandler resourceBundle:(NSBundle*)bundler;


@end